-- GENERATED SPELL FOR [Cabal Shadow Priest] --


function spell0_18637(pUnit, Event) --@Mind Flay,n/a--
pUnit:FullCastSpellOnTarget(17165,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18637', 3000, 1)
end

function spell1_18637(pUnit, Event) --@Mind Flay,n/a--
pUnit:FullCastSpellOnTarget(38243,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18637', 3000, 1)
end

function spell2_18637(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(14032,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18637', 18000, 1)
end

function spell3_18637(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(17146,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18637', 18000, 1)
end

function Sorts_18637(pUnit, Event)
local choix_sorts_18637 = math.random(0, 3)
if choix_sorts_18637 == 0 then
pUnit:RegisterEvent('spell0_18637', 1, 1)
end
if choix_sorts_18637 == 1 then
pUnit:RegisterEvent('spell1_18637', 1, 1)
end
if choix_sorts_18637 == 2 then
pUnit:RegisterEvent('spell2_18637', 1, 1)
end
if choix_sorts_18637 == 3 then
pUnit:RegisterEvent('spell3_18637', 1, 1)
end
end

function mob18637_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18637', math.random(1500, 3000), 1)
end

function mob18637_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18637_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18637_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18637, 1, 'mob18637_Action')
RegisterUnitEvent(18637, 2, 'mob18637_Leave')
RegisterUnitEvent(18637, 3, 'mob18637_Kill')
RegisterUnitEvent(18637, 4, 'mob18637_Die')
